package com.algorithm;


import java.math.BigDecimal;

/**
 * Created by jieming.chen on 2020/1/4
 */
public class test {
    public static void main(String[] args) {
        float a1 = 1f;
        float b1 = 0.9f;

        System.out.println(a1 / 1.0);
        System.out.println(0.9d / 1.0);

        System.out.println(a1 - b1);

        double a = 1;
        double b = 0.9;
        System.out.println(a - b);

        double d = 0.1d;
        BigDecimal bigDecimal = new BigDecimal(d);
        System.out.println(bigDecimal);

        BigDecimal bigDecimal1 = BigDecimal.valueOf(d);
        System.out.println(bigDecimal1);

//        double a = 1;
//        double b = 20.2;
        double c = 300.03;
        System.out.println(a + b + c);
        System.out.println(321.22999999999996);

        Double [] arr = {39.9d,50d,198d,39.9d};
        Double verify = 0d;
        for (Double aDouble : arr) {
            verify += aDouble ;
        }
        System.out.println(verify);
    }
}
